@foreach(['success','info','warning','danger'] as $name)
    @if(session()->has($name))
        <div class="alert alert-{{ $name }} alert-dismissible" role="alert" id="page_alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            {{ session($name) }}
        </div>
        <script>
            window.onload = function(){
                $(function () {
                    setTimeout(function () {
                        $('#page_alert').hide()
                    }, 3000)
                })
            };
        </script>
    @endif
@endforeach


